<% layout('/layout/default.html', {title: '发起任务', libs: ['dataGrid', 'icheck']}){ %>
<div class="main-content">
		<div class="card-header">
				<i class="fa fa-cubes"></i> 发起流程
			<div class="header-tools float-right">
				<a href="#" class="btn btn-sm btn-secondary" id="btnSearch" title="查询" ><i class="fa fa-filter"></i> 查询</a>
			</div>
		</div>
		<div class="container-fluid">
			<form id="searchForm" action="${ctx}/act/task/processDataList" method="post" class="form-inline d-none" >
				<div class="form-group">
					<label class="control-label">全部分类：</label>
					<div class="control-inline">
						<#form:select path="category" name="label" data="getDictList:act_category" class="form-control "></#form:select>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary ">查询</button>
					<button type="reset" class="btn btn-secondary ">重置</button>
				</div>
			</form>			
			<table id="btGrid"></table>
	</div>
</div>
<% } %>
<script>
//初始化DataGrid对象


$('#btGrid').BTGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{title:'流程分类', field:'categoryName', width:90, align:"center"},
		{title:'流程标识', field:'key', width:90, align:"center"},
		{title:'流程名称', field:'field', width:100, align:"center" },
		//{title:'流程资源', field:'proceDefResName', width:100, align:"center" },
		{title:'流程图', field:'diagramResourceName', width:100, align:"center",formatter: function(val, row, index){
			return '<a href="${ctx}/act/process/resource/read?procDefId='+row.id+'&resType=image"  class="btnList" title="流程图查看" data-type="diagram" >'+val+'</a>';
			
		} },
		{title:'流程版本', field:'version', width:80, align:"center",formatter: function(val, row, index){
			return 'V:'+val;
		} },
		{title:'更新时间', field:'deploymentTime', width:120, align:"center" },
		{title:'操作', field:'actions', width:100, align:"center",formatter: function(val, row, index){
			var actions = [];
			<% if(hasPermi('act:process:edit')){ %>
				actions.push('<a href="/act/task/form?procDefId='+row.id+'" class="btn btn-sm btn-success btnList" title="发起流程" >发起流程</a>');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>